Skip to content

Cape Town | 26-ITP-Sept | Vaidah Simenti | Sprint 2 | Coursework/Implement and Rewrite Tests - #1676

Open
Vaidah-dev wants to merge 12 commits into
CodeYourFuture:mainfrom
Vaidah-dev:coursework/sprint-3-implement-and-rewrite
Open

Vaidah-dev wants to merge 12 commits into
CodeYourFuture:mainfrom
Vaidah-dev:coursework/sprint-3-implement-and-rewrite

Conversation

@Vaidah-dev

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

(CYF-1059).

Changelist

-Implemented : getAngleType , isProperFraction , getCardValue and for each function ran tests using Node's built in test runner as well as rewriting using Jest.

@Vaidah-dev Vaidah-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 10, 2026
@hackertainment hackertainment added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 15, 2026

@hackertainment hackertainment left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for you coursework and just some minor fixes required. Please keep it up.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good coverage of test cases (except angle 90 tested two times ^^" ).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

});

test("Negative cases", () => {
assert.equal(isProperFraction(-2, 1), true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case should return false.

test("Negative cases", () => {
assert.equal(isProperFraction(-2, 1), true);
assert.equal(isProperFraction(1, -2), false);
assert.equal(isProperFraction(-1, -2), false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case should return true.

});

test("Zero cases", () => {
assert.equal(isProperFraction(0, 1), true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case should return false.

});

test("Zero cases", () => {
expect(isProperFraction(0, 1)).toEqual(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should be false.

test("Negative cases", () => {
expect(isProperFraction(-2, 1)).toEqual(true);
expect(isProperFraction(1, -2)).toEqual(false);
expect(isProperFraction(-1, -2)).toEqual(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should be true.

});

test("Negative cases", () => {
expect(isProperFraction(-2, 1)).toEqual(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should be false.

expect(() => getCardValue("♠")).toThrow();
expect(() => getCardValue("11♠")).toThrow();
expect(() => getCardValue("hello")).toThrow();
expect(() => getCardValue("")).toThrow();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this test case throw your Expected a number followed by a suit, but got "" error or throwing another type or error?

assert.throws(() => getCardValue("11♠"));
assert.throws(() => getCardValue("1♠"));
assert.throws(() => getCardValue("hello"));
assert.throws(() => getCardValue(""));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this test case throw your Expected a number followed by a suit, but got "" error or throwing another type or error?

@hackertainment hackertainment added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 15, 2026
@Vaidah-dev

Copy link
Copy Markdown
Author

Thank you for the review! I've addressed all the comments: fixed the isProperFraction tests, added error message checks to getCardValue, and cleaned up get-angle-type.

@Vaidah-dev Vaidah-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants